/*************************************************************************
	> File Name: mpu6050.h
	> Author: xxx
	> Mail: xxx 
	> Created Time: 2022年05月26日 星期四 22时11分57秒
 ************************************************************************/

#ifndef MPU6050_H
#define MPU6050_H

#define IOC_MAGIC  'c'
#define IOCINIT    _IO(IOC_MAGIC, 0)
#define IOCSETREGCMD    _IOWR(IOC_MAGIC, 1, unsigned char)
#define SLEEP     _IO(IOC_MAGIC, 2)
#define WAKEUP    _IO(IOC_MAGIC, 3)
#define TIMEOUT_WAKELOCK    _IO(IOC_MAGIC, 4)
#define LED_ON    _IO(IOC_MAGIC, 5)
#define LED_OFF    _IO(IOC_MAGIC, 6)


struct mpu6050_dev{
    struct miscdevice mpu_misc_device; //杂项设备
    struct i2c_client *client;
    struct regmap *regmap;
    u8  *buf;

    int irq_gpio;
    int led_gpio;
    char led_status;
    struct device_node *node;
    struct work_struct work;
    struct workqueue_struct *wq;
    struct wake_lock  wake_lock;
    wait_queue_head_t gyro_wait;
    volatile u8 dev_irq;
};






#endif
